'ScrapeLinks.vbs


URL = "http://news.google.com" 

Set fso = CreateObject("Scripting.FileSystemObject")
Set urlFile = fso.CreateTextFile("urls.txt", True)
' urlFile.WriteLine("")

set ie = CreateObject("InternetExplorer.Application")
'set ie = New InternetExplorer
ie.Visible = False
  ie.Navigate URL
  Do Until ie.ReadyState = 4
    Wscript.sleep 10
  Loop
  for each link in ie.document.links
    if Right(link, 3) = "doc" then
       urlFile.WriteLine link ' & link.InnerText
    end if
    'Wscript.echo link, link.InnerText
  next

' Uncomment the three lines below to scrape references to images
'  for each pix in .document.images
'  Wscript.echo pix.src
'  next
  
  ie.Quit
  set ie = Nothing
  set fso = Nothing

Wscript.echo "Done!"